import React, { Component } from 'react'
import { findDOMNode } from 'react-dom'
import Com from './Com'

export default class MyRef extends Component {
    html = null
    com = null
    render() {
        return (
            <div>
                {/* <h3 ref="title">我是标题</h3> */}
                <h3 ref={(html) => {
                    this.html = html
                }}>我是标题</h3>

                <Com ref={(com) => {
                    this.com = com
                }}/>
            </div>
        )
    }
    componentDidMount() {
        console.log(findDOMNode(this.com))
    }
}
